@import "global.css";
@import "code.css";

.index {
  margin: 15px;
  display: block;
  font-size: 18px;
  color: #aaa;
  text-decoration: none;
  position: absolute;
  z-index: 1;
  font-weight: bold;
}
.menu {
  margin: 15px;
  position: absolute;
  font-size: 18px;
  z-index: 1;
  font-weight: bold;
  right: 0;
  .menu-item {
    float: right;
    margin-right: 10px;
    a {
      color: #aaa;
    }
  }
}
a.name {
  color: #444;
}
.main {
  color: #4A4A4A;
  margin: 0 auto;
  max-width: 720px;
  padding: 0 15px;
  min-height:100%;
  position:relative;
  .site {
    .logo {
      margin: 0 auto;
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background-size: cover;
      background-repeat: no-repeat;
      border: 1px #eee solid;
    }
    .title {
      margin: 0;
      margin-top: 30px;
      font-weight: bold;
      font-size: 32px;
      text-align: center;
    }
    .subtitle {
      @mixin font-main;
      font-style: italic;
      margin-top: 10px;
      font-size: 16px;
      color: #bbb;
      text-align: center;
      font-weight: normal;
    }
  }
  &.page {
    padding-top: 100px;
    padding-bottom: 70px;
    .header {
      text-align: center;
      .tag {
        margin: 0;
        margin-top: 30px;
        font-weight: bold;
        font-size: 32px;
      }
      .tag-sub {
        margin: 0;
        font-weight: normal;
        margin-top: 10px;
        font-size: 16px;
        color: #bbb;
      }
      .search-wrap {
        position: relative;
        max-width: 300px;
        margin: 0 auto;
        margin-top: 50px;
        .search {
          padding: 10px 25px;
          border: 1px solid #ddd;
          border-radius: 100px;
          width: 100%;
          box-sizing: border-box;
          opacity: 0.8;
          &:focus {
            outline: 0;
            opacity: 1;
          }
        }
        .icon {
          position: absolute;
          right: 10px;
          top: 5px;
          opacity: 0.3;
        }
      }
    }
    .article-list {
      margin-top: 100px;
      .searched {
        background-color: #bfedff;
      }
      .article {
        margin-bottom: 55px;
        padding-bottom: 45px;
        border-bottom: 1px #ddd dashed;
        &:last-child {
          border-bottom: 0;
        }
        .title {
          font-size: 26px;
          font-weight: bold;
          margin-bottom: 5px;
          text-decoration: none;
          color: #4A4A4A;
          display: block;
          .top {
            color: #ccc;
            margin-right: 5px;
          }
        }
        .cover {
          color: #fff;
          width: 100%;
          height: 280px;
          background-size: cover;
          background-position: center;
          background-repeat: no-repeat;
          border-radius: 6px;
          border: 1px solid #ddd;
          box-sizing: border-box;
          margin-top: 15px;
          margin-bottom: 10px;
        }
        .preview {
          @mixin font-main;
          display: inline-block;
          line-height: 28px;
          font-size: 16px;
          margin-top: 10px;
          color: #666;
        }
        .info {
          margin-top: 15px;
          margin-bottom: 20px;
          color: #333;
          font-size: 14px;
        }
        .avatar {
          width: 20px;
          height: 20px;
          margin-right: 10px;
          border-radius: 20px;
          background-size: cover;
          background-repeat: no-repeat;
          float: left;
          margin-top: -4px;
          border: 1px #eee solid;
        }
        .name {
          margin-right: 10px;
        }
        .date {
          color: #ccc;
        }
        .tags {
          @mixin font-main;
          margin-left: 10px;
          float: right;
          .tag {
            margin-right: 5px;
            color: #bbb;
            text-decoration: none;
          }
        }
      }
      .empty {
        text-align: center;
        font-size: 24px;
        max-width: 800px;
        overflow: hidden;
        text-overflow: ellipsis;
        span {
          font-weight: bold;
        }
      }
    }
    .page-nav {
      position: relative;
      height: 50px;
      a {
        color: #bbb;
        font-style: italic;
        text-decoration: none;
      }
      .nav {
        left: 0;
        right: 0;
        text-align: center;
        display: block;
        color: #bbb;
        position: absolute;
        z-index: -1;
      }
      .prev {
        float: left;
        &:before {
          content: "";
          width: 3px;
          height: 3px;
          border: 2px #ccc solid;
          border-radius: 3px;
          display: block;
          float: left;
          margin-right: 7px;
          margin-top: 5px;
        }
      }
      .next {
        float: right;
        &:after {
          content: "";
          width: 3px;
          height: 3px;
          border: 2px #ccc solid;
          border-radius: 3px;
          display: block;
          float: right;
          margin-left: 7px;
          margin-top: 5px;
        }
      }
    }
  }
  &.article {
    padding-top: 120px;
    padding-bottom: 120px;
    .title {
      margin: 0;
      font-weight: bold;
      color: #4A4A4A;
      font-size: 30px;
      line-height: 42px;
    }
    .info {
      margin-top: 10px;
      font-size: 14px;
      .avatar {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        border-radius: 20px;
        background-size: cover;
        background-repeat: no-repeat;
        float: left;
        margin-top: -4px;
        border: 1px #eee solid;
      }
      .name {
        margin-right: 5px;
      }
      .date {
        color: #ccc;
        margin-right: 5px;
      }
      .tags {
        @mixin font-main;
        color: #ccc;
        .tag {
          margin-right: 5px;
          color: #bbb;
          text-decoration: none;
        }
      }
    }
    .recommend {
      margin-top: 50px;
      overflow: auto;
      .nav {
        width: 100%;
        .head {
          font-size: 12px;
          font-style: italic;
          margin-bottom: 10px;
          color: #c4c4c4;
          text-align: center;
        }
        .link {
          color: #4A4A4A;
          text-align: center;
          display: block;
        }
        &.prev.more {
          width: 45%;
          text-align: left;
          float: left;
          .head, .link  {
            text-align: left;
          }
        }
        &.next.more {
          width: 45%;
          text-align: right;
          float: right;
          .head, .link {
            text-align: right;
          }
        }
      }
    }
    .author {
      margin-top: 36px;
      padding-top: 40px;
      text-align: center;
      .avatar {
        margin: 0 auto;
        width: 70px;
        height: 70px;
        border-radius: 70px;
        background-size: cover;
        background-repeat: no-repeat;
        border: 20px #fff solid;
        &:before {
          border-top: 1px #ccc dashed;
          content: "";
          width: 100%;
          position: absolute;
          left: 0;
          right: 0;
          margin-top: 36px;
          z-index: -1;
        }
      }
      .name {
        margin-top: 20px;
        font-weight: bold;
        font-size: 16px;
      }
      .intro {
        @mixin font-main;
        font-style: italic;
        margin-top: 8px;
        font-size: 14px;
        color: #bbb;
      }
    }
    #disqus_thread {
      margin-top: 50px;
    }
  }
  &.about {
    .info {
      margin-top: 80px;
      text-align: center;
    }
  }
  &.archive, &.tag {
    padding-top: 100px;
    padding-bottom: 100px;
    a {
      color: #000;
    }
    .site {
      .title, .subtitle {
        text-align: left;
        @mixin font-main;
      }
    }
    .header {
      padding-top: 60px;
      .title {
        margin-top: 30px;
        margin-right: 5px;
        font-weight: bold;
        background-color: black;
        color: white;
        padding: 3px 5px;
      }
      .subtitle {
        @mixin font-main;
        margin-top: 10px;
        padding: 3px 5px;
        font-style: italic;
        color: #bbb;
      }
    }
    .archive-list {
      margin-top: 50px;
      .archive-item {
        margin: 40px 0;
        .archive-year {
          margin: 15px 0;
          color: #aaa;
        }
        .article-list {
          .article-item {
            margin-bottom: 10px;
            .date {
              color: #aaa;
              margin-right: 20px;
            }
          }
        }
      }
    }
    .tag-list {
      margin-top: 50px;
      .tag-item {
        margin-right: 10px;
        margin-bottom: 25px;
        float: left;
        .tag-name {
          padding: 5px 7px;
          border: 1px solid #eee;
          border-radius: 3px;
          font-size: 14px;
          &:hover {
          background-color: black;
          color: white;
          border: 1px solid black;
          }
        }
      }
    }
  }
  .content {
    @mixin font-main;
    margin-top: 70px;
    font-size: 16px;
    line-height: 1.7;
    color: #4A4A4A;
    h1, h2, h3, h4, h5, h6 {
      @mixin font-main;
      & + p {
        margin-top: 10px;
      }
    }
    h1 {
      font-size: 28px;
      margin-top: 40px;
      margin-bottom: 10px;
    }
    h2 {
      font-size: 24px;
      margin-top: 40px;
      margin-bottom: 10px;
    }
    h3 {
      font-size: 18px;
      margin-top: 40px;
      margin-bottom: 10px;
    }
    p {
      margin-bottom: 30px;
      margin-top: 30px;
      text-align: left;
    }
    a {
      color: #000;
      text-decoration: none;
      border-bottom: 1px dotted #000;
      &:hover {
        color: #4A4A4A;
        border-bottom: 1px dotted #4A4A4A;
      }
    }
    code {
      @mixin font-code;
      font-size: 14px;
      padding: 1px 4px;
      border-radius: 2px;
      margin: 0px 3px;
      border: 1px solid #E4E4E4;
      background-color: #f9f9f9;
    }
    pre {
      margin: 0;
      code {
        @mixin font-code;
        font-size: 14px;
        margin: 0;
        padding: 10px 15px;
        border-radius: 6px;
        border: 2px dashed #ece7e7;
        background-color: #fdfcfc;
        display: block;
        overflow: auto;
      }
    }
    blockquote {
      border-left: 4px #6b6b6b solid;
      padding: 0px 10px 0px 20px;
      margin: 25px 0;
      margin-left: -23px;
      font-style: italic;
    }
    table {
      font-size: 14px;
      width: 100%;
      border-width: 1px;
      border-color: #ddd;
      border-collapse: collapse;
      th {
        border-width: 1px;
        padding: 5px;
        border-style: solid;
        border-color: #ddd;
        background-color: #eee;
      }
      td {
        border-width: 1px;
        padding: 5px;
        border-style: solid;
        border-color: #ddd;
        background-color: #fff;
      }
    }
    ul {
      list-style: circle;
      padding-left: 40px;
      li {
        margin: 5px 0;
      }
    }
    ol {
      padding-left: 40px;
      li {
        margin: 5px 0;
      }
    }
    hr {
      margin: 25px 0;
      border: 0;
      border-top: 1px dashed #ccc;
    }
    img {
      margin: 30px auto;
      max-width: 100%;
      display: block;
      opacity: 0.6;
      transition: opacity .3s ease-in;
      cursor: pointer;
    }
    .image-alt {
      text-align: center;
      color: #aaa;
      font-style: italic;
      margin-top: -10px;
      margin-bottom: 30px;
    }
  }
}
.container {
  height: auto;
  min-height: 100%;
  padding-bottom: 0;
}
.footer {
  width: 100%;
  font-size: 14px;
  border-top: 1px #eee solid;
  color: #bbb;
  background-color: #fff;
  clear: both;
  position: relative;
  height: 32px;
  margin-top: -36px;
  span {
    padding: 8px 15px;
    display: block;
    a {
      font-weight: bold;
    }
  }
  .copyright {
    float: left;
  }
  .publish {
    float: right;
    a {
      color: #bbb;
      text-decoration: none;
    }
  }
}
